<template>
  <div class="nav-bar flex align-center justify-center hand p-t-40 p-b-15">
    <div :class="index?'m-l-40':''" v-for="(item,index) of routesList" @click="jump(item.path)" :key="index">
      <span v-if="item.meta">{{item.meta.title || ''}}</span>
    </div>
  </div>
</template>
<script lang="ts">
import {routes} from "../../../router"
import { useRouter } from 'vue-router'
import {reactive, ref, toRefs} from "vue";
export default {
  setup() {
    let router = useRouter()
    let obj = routes.find(e=>e.path=='/test') || {children:[]}
    let routesList = ref(obj.children)

    let jump = (url:string)=>{
      router.push(`/test/${url}`)
    }
    return {routesList,jump,router}
  },
}

</script>
<style lang="scss" scoped>
.nav-bar {
}
</style>
